package com.kaili.basic.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.kaili.basic.mapper.MdmGroupMapper;
import com.kaili.basic.pojo.dto.MdmGroupQueryByPageDto;
import com.kaili.basic.pojo.entity.MdmGroupEntity;
import com.kaili.basic.pojo.vo.MdmGroupQueryAllVo;
import com.kaili.basic.service.MdmGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class MdmGroupServiceImpl implements MdmGroupService {
    @Autowired
    private MdmGroupMapper mdmGroupMapper;
    @Override
    public Page<MdmGroupQueryAllVo> queryPageList(Page<MdmGroupQueryAllVo> page, MdmGroupQueryByPageDto mdmGroupQueryByPageDto) {
        List<MdmGroupQueryAllVo> mdmGroupQueryAllVoList = mdmGroupMapper.queryPageList(page,mdmGroupQueryByPageDto);
        return page.setRecords(mdmGroupQueryAllVoList);
    }

    @Override
    public void add(MdmGroupEntity mdmGroupEntity) {
        mdmGroupMapper.add(mdmGroupEntity);
    }

    @Override
    public void delete(int id) {
        mdmGroupMapper.delete(id);
    }

    @Override
    public void update(MdmGroupEntity mdmGroupEntity) {
        mdmGroupMapper.update(mdmGroupEntity);
    }

    @Override
    public List<MdmGroupQueryAllVo> queryGroupExport(MdmGroupQueryByPageDto mdmGroupQueryByPageDto) {
        return mdmGroupMapper.queryGroupExport(mdmGroupQueryByPageDto);
    }

    @Override
    public String getCode() {
        return mdmGroupMapper.getCode();
    }

    @Override
    public MdmGroupEntity queryGroupById(int id) {
        return mdmGroupMapper.queryGroupById(id);
    }

    @Override
    public List<MdmGroupEntity> queryGroupByOrgId(int id) {
        return mdmGroupMapper.queryGroupByOrgId(id);
    }
}
